<template>
	<view class="">
		<view class="list">
			<view class="one-product" style="margin-top: 20rpx;">
				<view class="d-f">
					<view class="info flex-1 p-0-20">
						<view class="">
							订单号：{{detail.orderInfo.order_no}}
						</view>
						<view class="d-b-s">
							<view class="flex-1">
								<view class="title f32 gray3 " style="font-weight:700">
									{{ formatStr(detail.orderInfo.product_name, 40) }}
								</view>
								<view class="describe mt20 f28" style="font-size: 22rpx;color: #B1B1B1;">
									{{ detail.orderInfo.product_attr }}
								</view>
								<view class="mt10 f20" style="color: #B1B1B1;">数量：{{ detail.orderInfo.total_num }}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="d-f">
					<view class="info p-0-20">
						<view class="">
							{{detail.title}}
						</view>
						<view class="">
							{{detail.content}}
						</view>
					</view>
				</view>
				<view style="display: flex;gap:20">
					<image :src="item" style="width:160rpx;height: 160rpx;" mode="aspectFit" v-for="(item,index) in  detail.images"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: "",
				detail: {}
			}
		},
		onLoad(option) {
			this.id = option.id
			this.getPlantDatail()
		},
		methods: {
			formatStr(str, type /*'date'|'money'|'week'|num */ ) {
				if (type === 'date')
					return str.substring(0, 10);
				if (typeof type === 'number')
					return `${str.substring(0, type)}...`;
				if (type === 'money')
					return str ? str : '-';
			},
			getPlantDatail() {
				let self = this
				self._post('order.complaint/detail', {
					id: self.id
				}, function(res) {
					if (res.code == 1) {
						self.detail = res.data
						console.log(self.detail)
						
					}
				})
			}
		}
	}
</script>

<style>
</style>